<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script type="text/javascript">
			document.write('<script src="../../js/fix.js?rd=?rd=' + Math.random() + '"><\/script>');
		</script>
		<script type="text/javascript">
			link(['../../css/font-awesome.min.css', '../../fonts/iconfont/iconfont.css']);
		</script>
		<script type="text/javascript">
			script(['../../js/PinYinUti.js', "../../js/H5+.js"]);
		</script>
		<style type="text/css">
			* {
				padding: 0;
				margin: 0;
			}

			html,
			body {
				background: #f8f8f8;
			}



			.searchinfo {
				width: 100%;
				background: #47BAFE;
				/* box-shadow:0 1px 2px 0 rgb(229, 240, 253), 0 2px 10px 0 rgb(229, 240, 253); */
				height: 60px;
				color: #FFFFFF;
				/* background-color: #fff; */
				display: flex;
				align-items: center;
				/* justify-content: center; */
				padding-left: 0.1rem;
				position: fixed;
			}

			.mui-content .mui-indexed-list-search {
				width: 85%;
				height: 60px;
				line-height: 60px;
				border: 0;
				display: flex;
				align-items: center;
				color: #a6bfcd;
				border-radius: 5px !important;
				z-index: 0;
			}


			.mui-indexed-list-search .mui-placeholder span:last-child {
				font-size: 0.16rem;
				margin-left: 0.05rem
			}

			.mui-content .mui-indexed-list-search .mui-placeholder,
			.mui-content .mui-indexed-list-search .mui-icon-search {
				color: #999;
				font-size: 0.24rem;
			}

			#inpt {
				padding-left: 40px;
				border-radius: 5px !important;
				height: 40px;
				font-size: 0.18rem;

			}

			.mui-search .mui-placeholder {
				height: 60px;
				line-height: 60px;
				text-align: left !important;
				padding-left: 0.1rem;
				font-size: 0.18rem;
			}

			.mui-search:before {
				height: 35px !important;
				line-height: 40px;
				font-size: 0.24rem !important;
				padding-left: 10px;
				transform: translateX(-5px);
			}



			.mui-input-row.mui-search .mui-icon-clear {
				line-height: 42px;
				height: 42px;
			}

			.mui-indexed-list-search input {
				background-color: #f8f8f8;
				border-radius: 0px !important;
				color: #a6bfcd;
				margin: 0;
				padding: 0rem;

			}

			.sorticon {
				text-align: center;
				display: inline-block;
				height: 50px;
				line-height: 50px;
				width: 15%;
				font-size: 24px;
			}



			.mui-content .linkman {
				background-color: #fff;
				margin-top: 90px;
				width: 100%;
			}

			.mui-content .linkman .gehe {
				width: 100%;
				height: 10px;
				background-color: #e9f0f4;
				position: fixed;
			}

			.mui-content .linkman .head {
				width: 100%;
				height: 45px;
				line-height: 45px;
				color: #47BAFE;
				display: flex;
				justify-content: center;
				position: fixed;
				/* top: 1rem; */
				z-index: 111;
				background-color: #fff;
				border-bottom: 1px solid #c0d3df;
			}

			.mui-content .linkman .head span {
				text-align: center;
				flex: 1;
				overflow: hidden;
				position: relative;
			}

			.mui-content .linkman .head span p {
				display: inline-block;
				width: 0.07rem;
				height: 0.05rem;
				background: url(../../images/xxia.png) no-repeat;

				background-size: 100% 100%;
				margin: 0;
			}


			/* 	.mui-content .linkman ul li div {
				display: flex;
				align-items: center;
			} */
			.ulList {
				list-style: none;
				flex-flow: wrap;
				display: flex;
				padding-top: 0.2rem;
				background: #f8f8f8;
			}

			.removeDiv {
				width: 100%;
				height: 100%;
				position: absolute;
				top: 0rem;
				left: 0rem;
				background-color: rgba(210, 210, 210, 0.15);
				transform: translateX(-100%);
				-webkit-transform: translateZ(-100);
				-webkit-perspective: 1000;
				-webkit-backface-visibility: hidden;
				transition: transform .3s;
				border-radius: 15px;
			}

			.removeDiv2 {
				width: 100%;
				height: 100%;
				position: absolute;
				top: 0rem;
				left: 0rem;
				background-color: rgba(210, 210, 210, 0);
				border-radius: 10px;
			}

			.removeDiv2 .iconxuanzhong4 {
				font-size: 0.4rem;
				text-align: right;
				height: 0.4rem;
				line-height: 0.4rem;
				color: #47BAFE;
			}

			.ulList li {
				width: 50%;
				background: #FFFFFF;
				padding: 0.05rem;
				border: 5px solid #f8f8f8;
				border-radius: 13px;
				box-sizing: border-box !important;
				position: relative;
				overflow: hidden;
				transition: background-color .5s;
			}




			.ulList li #customername {
				overflow: hidden;
				display: inline-block;
				vertical-align: middle;
				padding: 0px 0.05rem;
				width: calc(100% - 0.35rem);
				text-overflow: ellipsis;
				white-space: nowrap;
				height: 0.3rem;
				color: #545454;
				margin: 0rem;
				line-height: 0.3rem;
				font-weight: bold;
			}

			.insertStar {
				display: inline-block;
				width: 0.35rem;
				height: 0.35rem;
				margin: 0rem;
				padding: 0rem;
				text-align: right;
				vertical-align: middle;
				line-height: 0.35rem;
			}

			.insertStar img {
				width: 0.28rem;
				vertical-align: super;
				height: 0.28rem;
			}

			.col-center img {
				width: 0.55rem;
				height: 0.55rem;
			}

			.col-bottom .last_touch_date {
				width: calc(100% - 0.5rem);
				display: inline-block;
				padding-left: 0.05rem;
				color: #9C9C9C;
			}

			.col-bottom>span {
				float: right;
				/* padding-right: 0.05rem; */
				font-size: 0.25rem;
				color: #47BAFE;
				padding-bottom: 0.05rem;
				/* transform: translateY(-0.1rem); */
			}

			.col-bottom>p {
				font-size: 0.13rem;
				margin: 0rem;
			}

			.mui-content .linkman ul li div .touxiang img {
				height: 0.34rem;
				border-radius: 17px;
				margin-top: 0.06rem;
			}

			.mui-content .linkman ul li div .star img {
				width: 0.15rem;
				height: 0.15rem;
				margin-top: 0.02rem;
			}


			#topPopover {
				position: fixed;
				top: 0.5rem;
				width: 1.5rem;
				right: 0px;
				height: 1rem;
				right: 0.15rem;
				z-index: 1002;
				display: none;
				margin-right: -0.05rem;
			}

			#topPopover:before {
				content: '';
				width: 0;
				height: 0;
				border: 0.1rem solid transparent;
				/*调整小三角形的大小*/
				border-bottom-color: white;
				position: absolute;
				right: 0.1rem;
				/*调整小三角形的位置*/
				bottom: 100%;
				/*调整小三角形的位置*/
				margin-top: 0.2rem;
				/*调整小三角形的位置*/

			}

			#topPopover .mui-scroll-wrapper {
				margin-top: 0.05rem;
			}

			.mui-popover.mui-active {
				width: 1.4rem;
				background-color: white;
				display: block;
				top: 0.5rem !important;
			}

			#topPopover .mui-scroll li span {
				margin-right: 0.1rem;
			}

			#topPopover .more_ul:before,
			.more_ul:after {
				background: none;
			}

			#topPopover .more_ul {
				border-radius: 10px;
				overflow: hidden;
			}

			#topPopover .more_ul li {
				padding: 0px;
				border: none;
				padding-left: 0.2rem;
				padding-top: 0.04rem;
				height: 0.45rem;
				line-height: 0.45rem;
			}

			.mui-hidden {
				z-index: 1;
			}

			.line {
				display: inline-block;
				width: 0.15rem;
				height: 0.15rem;
				border-radius: 15px;
				background-color: #4b9cdb;
			}

			.ring-1 {
				width: 0.1rem;
				height: 0.1rem;
				margin: 0 auto;
				padding: 0.1rem;
				border: 0.07rem dashed #4b9cdb;
				border-radius: 100%;
			}



			.ball-holder {
				position: absolute;
				width: 0.12rem;
				height: 0.45rem;
				left: 0.17rem;
				top: 0px;
			}

			.load-1 .line:nth-last-child(1) {
				animation: loadingA 1.5s 1s infinite;
			}

			.load-1 .line:nth-last-child(2) {
				animation: loadingA 1.5s .5s infinite;
			}

			.load-1 .line:nth-last-child(3) {
				animation: loadingA 1.5s 0s infinite;
			}


			@keyframes loadingA {
				0 {
					height: 0.15rem;
				}

				50% {
					height: 0.35rem;
				}

				100% {
					height: 0.15rem;
				}
			}

			#loading {
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}

			.mask {
				position: fixed;
				width: 100vw;
				height: 100vh;
				background-color: rgba(0, 0, 0, 0.3);
				z-index: 1001;
				top: 43px;
				display: none;
			}


			.mui-content-padded {
				margin: 0px;
				box-shadow: none;
				padding: 0rem;

			}

			.mui-content .point_box {
				padding: 0px 0.1rem;
				/* position: absolute; */
				box-sizing: border-box;
				border: 1px solid #eee;
				width: 90%;
				margin-left: 5%;
				margin-top: 0.1rem;
				border-radius: 5px;
				background: #fafafa;
				/* box-shadow: 0px 0px 0.15rem -0.05rem #47bafe; */
			}

			#telImp,
			#wxImp {
				padding: 0.13rem;
				font-size: 0.2rem;
			}

			.point_box p {
				text-align: left;
				font-size: 0.15rem;
				margin-bottom: 0.05rem;
				line-height: 0.24rem;
			}

			.actionButton {
				line-height: 0.22rem;
			}

			.paixubox {
				height: 180px;
				position: fixed;
				top: 103px;
				transform: translateY(-200px);
				width: 100%;
				background: #FFFFFF;
				z-index: 1;
				overflow: hidden;
				transition: all .2s;
			}

			.paixubox p {
				height: 45px;
				line-height: 45px;
				margin: 0rem;
				color: black;
				padding: 0rem 20px;
				border-bottom: 1px solid #EEEEEE;
			}

			.paixubox p:active {
				color: #47BAFE !important;
			}

			.paixubox p:last-child {
				border: none;
			}

			.paixuboxShow {
				overflow: auto !important;
			}


			.jiantoufh {
				animation: xuanzicon .2s;
				animation-iteration-count: 1;
				/* 规定动画无限次执行 */
				animation-timing-function: linear;
				transform: rotate(180deg);

			}

			.jiantoufh2 {

				animation: xuanzicon2 .2s;
				animation-iteration-count: 1;
				/* 规定动画无限次执行 */
				animation-timing-function: linear;

			}

			@keyframes xuanzicon2 {
				from {

					transform: rotate(180deg);
				}

				to {

					transform: rotate(0deg);
				}
			}

			@keyframes xuanzicon {
				from {

					transform: rotate(0deg);
				}

				to {

					transform: rotate(180deg);
				}
			}

			.paixuspan {
				width: 40% !important;
				color: #999999;
				display: inline-block;
			}

			.detelebox {
				display: inline-block;
				width: 50%;
				text-align: right;
				color: #999999;
				padding-right: 5%;
				border-left: .5px solid #EEEEEE;
			}

			.detelebox span {
				padding: 0px 0.1rem;
			}

			.detelebox span:last-child {
				font-size: 0.3rem;
				height: 0.5rem;
				line-height: 0.5rem;
				vertical-align: middle;
			}

			#paixutext {
				width: 50% !important;
				overflow: hidden;
				display: inline-block;
				text-overflow: ellipsis;
				white-space: nowrap;
				text-align: center;
			}

			#jiantoufh {
				display: inline-block;
				padding: 0rem 0.2rem;
			}


			#mask2 {
				z-index: 0;
			}

			.head {
				position: relative;
				z-index: 111;
			}

			.mui-icon-clear {
				margin: 0rem;
				margin-top: 0.02rem;
			}


			@keyframes removeliam {
				0% {
					transform: rotate(2deg);
				}

				25% {
					transform: rotate(-2deg);
				}

				50% {
					transform: rotate(2deg);
				}

				75% {
					transform: rotate(-2deg);
				}

				100% {
					transform: rotate(2deg);
				}

			}

			.mui-popup-button:first-child {
				color: #47BAFE;
			}

			.mui-popup-button-bold {
				color: #47BAFE !important;
			}

			#batch_handle_box {
				flex-flow: wrap;
				position: fixed;
				bottom: 0.15rem;
				width: 96%;
				background: #47BAFE;
				z-index: 111;
				padding: 0.05rem 0rem;
				/* border:1px solid #F8F8F8; */
				box-shadow: 0 15px 10px 0 rgb(150, 210, 245, 0.4), 0 15px 10px 0 rgb(177, 189, 195, 0.4);
				left: 2%;
				border-radius: 10px;
				display: none;

			}

			#batch_handle_box div {
				flex: 1;
				text-align: center;
				border-right: .5px solid #F8F8F8;
			}

			#batch_handle_box div:last-child {
				border: none;
			}

			#batch_handle_box div p {
				height: 0.27rem;
				margin: 0rem;
				line-height: 0.27rem;
				font-size: 0.13rem;
				color: #FFFFFF;
			}

			#batch_handle_box div p:first-child {
				font-size: 0.25rem;
				color: #FFFFFF;
			}

			#batch_handle_box .tipXZ {
				color: #FFFFFF;
				height: 0.5rem;
				line-height: 0.5rem;
				width: 1.5rem;
			}

			#batch_handle_box .tipXZ span {
				display: block;
				height: 0.25rem;
				line-height: 0.25rem;
			}

			.mask_navBox {
				position: fixed;
				display: none;
				top: 0rem;
				left: 0rem;
				height: 100%;
				width: 100%;
				z-index: 1000;
				background-color: rgba(0, 0, 0, 0.7);
			}

			.khzd_box {
				height: 42vh;
				text-align: center;
				position: relative;
				width: 100%;
			}

			.mask_navBox .text {
				margin: 0.15rem 0.15rem;
				font-size: 0.2rem;
				color: #FFFFFF;
				line-height: 0.33rem;
			}

			.mask_navBox .khzd {
				width: 78%;
				height: 0.5rem;
				position: absolute;
				background: red;
				bottom: 0.55rem;
				left: 11%;
				border-radius: 50px;
			}

			.jiantou {
				position: absolute;
				top: 42%;
				z-index: 1220;
				height: 1.5rem;
				display: block;
				left: 50%;
				transform: translateX(-50%);
			}

			.mask_navBox .btn {
				display: block;
				width: 1.2rem;
				float: right;
				border-radius: 10px;
				color: #FFFFFF;
				margin-right: 0.2rem;
				font-size: 0.22rem;
				height: 0.4rem;
				transform: translateY(-0.1rem);
				line-height: 0.4rem;
				box-sizing: content-box;
				text-align: center;
				border: 0.03rem solid #FFFFFF;
			}

			.kehuCard {
				width: calc(50% - 0.2rem);
				display: block;
				border-radius: 0.1rem;
				margin-top: 115px;
				margin-left: 0.1rem;
			}

			.card_active {
				border-radius: 0.1rem;
				width: calc(50% - 0.15rem);
				display: block;
				border-radius: 0.1rem;
				margin-top: 100px;
				margin-left: 0.1rem;
			}

			.batch {
				width: calc(100% - 0.3rem);
				margin-left: 0.15rem;
				position: absolute;
				bottom: 0.25rem;
				border-radius: 0.1rem;
			}
		</style>
	</head>

	<body>

		<div class="mask" id="mask"></div>
		<div class="mask_navBox" id="mask_navBox">
			<div id="kehu_yes" style="display: none;">
				<img src="../../images/mask_nav/kehuCard.png" class="kehuCard" alt="">
				<img src="../../images/mask_nav/jiantou3.png" style="display: block;margin: 0.1rem auto;" alt="">
				<div class="text">1. 卡片的<span style="color: #ee630e;">数字越高，潜力越大</span>。点击卡片，可以查看详细画像</div>
				<a href="javascript:;" class="btn" onclick="button_nav(6)">下一步</a>
			</div>
			<div id="kehu_yes2" style="display: none;">
				<div class="text" style="margin-top: 100px;">2. 长按卡片，支持多选，<span style="color: #ee630e;">可以批量删除或者批量使用灵豹券</span></div>
				<a href="javascript:;" class="btn" onclick="button_nav(7)">知道了</a>
				<img src="../../images/mask_nav/card_active.jpg" class="card_active" alt="">
				<img src="../../images/mask_nav/jiantou3.png" style="transform: rotate(30deg);display: block;margin: 0 auto;margin-right: 25%;"
				 alt="">
				<img src="../../images/mask_nav/batch.png" class="batch" alt="">
			</div>

			<div style="position: relative;display: none;" id="mask_nav1">
				<img src="../../images/mask_nav/jiantou.png" class="jiantou" alt="">
				<div class="khzd_box">
					<img src="../../images/mask_nav/khzd.png" alt="" class="khzd">
				</div>
				<img src="../../images/mask_nav/setting0.png" style="margin: 0 auto; display: block;width: 85% ;" alt="">
				<div class="text">1.为了确保模型分析有足够内存，<span style="color: #ee630e;">建议先清空所有后台应用后，重新启动灵豹APP
					</span>然后点击诊断按钮，将弹窗提示开启辅助功能，<span style="color: #ee630e;">请选择「是」</span></div>
				<a href="javascript:;" class="btn" onclick="button_nav(1)">下一步</a>
			</div>
			<div id="mask_nav2" style="display: none;">
				<img src="../../images/mask_nav/setting2.png" style="margin: 0 auto;margin-top: 2rem; display: block;width: 90% ;"
				 alt="">
				<div class="text">2. 在无障碍应用列表中，<span style="color: #ee630e;">查找「灵豹」APP</span>，点击设置</div>
				<a href="javascript:;" class="btn" onclick="button_nav(2)">下一步</a>

			</div>
			<div id="mask_nav3" style="display: none;">
				<img src="../../images/mask_nav/setting3.png" style="margin: 0 auto;margin-top: 2rem; display: block;width: 90% ;"
				 alt="">
				<div class="text">3. 点击开关按钮，<span style="color: #ee630e;">开启自动诊断功能</span>，点击「确定」</div>
				<a href="javascript:;" class="btn" onclick="button_nav(3)">下一步</a>
			</div>
			<div id="mask_nav4" style="display: none;">
				<div class="khzd_box">
					<img src="../../images/mask_nav/khzd.png" alt="" class="khzd">
				</div>
				<img src="../../images/mask_nav/jiantou.png" style="display: block;margin: 0.15rem auto;height: 1.3rem; transform: rotate(160deg);"
				 alt="">
				<br>
				<div class="text">4. 返回客户诊断页面，重新点击<span style="color: #ee630e;">「潜在客户诊断」
					</span>按钮</div>
				<a href="javascript:;" class="btn" onclick="button_nav(4)">下一步</a>
			</div>
			<div id="mask_nav5" style="display: none;">
				<img src="../../images/mask_nav/setting4.png" style="margin: 0 auto;margin-top: 1.8rem; display: block;width: 90% ;"
				 alt="">
				<div class="text">5. APP开始自动诊断朋友圈数据。诊断过程中微信将自动跳转，<span style="color: #ee630e;">请暂时不要操作手机</span></div>
				<a href="javascript:;" class="btn" onclick="button_nav(5)">知道了</a>
			</div>
		</div>

		<div id="zanwushuju" class="mui-content" style=" background-color: #FFFFFF; height: 100vh;padding-top:60px;">
			<header class="mui-bar mui-bar-nav">
				<h1 class="mui-title">客户列表</h1>
				<a class="mui-icon mui-icon mui-icon-help mui-pull-right " onclick="showSide()"></a>
			</header>

			<div class="mui-content-padded box" style="text-align: center;">
				<div>
					<img src="../../images/customer/ch.png" style="width : 1.3rem" />
				</div>
				<div style="margin: 0.05rem 0px;">
					<a style="color: #47BAFE;font-size: 0.17rem;">还没有添加客户信息，快去诊断吧</a>
				</div>
				<button id="telImp" class="mui-btn mui-btn-block mui-btn-primary actionButton" style=" margin-top: 0.1rem;margin-bottom: 0.15rem;">
					<span class="iconfont " style="font-size: 0.23rem !important;">&#xe635;</span>
					潜在客户诊断
				</button>

				<div class="point_box">
					<div style="display: flex;align-items: center;margin-top: 0.07rem;margin-bottom: 0.05rem;">
						<span style="color: #47BAFE;font-size: 0.16rem;"><span class="mui-icon mui-icon-info" style="font-size: 0.23rem;">&nbsp;</span>诊断说明</span>
					</div>
					<p>
						1、灵豹将对您的手机好友及微信好友进行诊断，识别高潜力客户。<span style="color: #47BAFE;">相关数据仅在为您提供销售决策时使用，不会对第三方泄漏。</span>

					</p>
					<p>
						2、诊断过程中需要操作您的手机，请您按照提示<span style="color: #47BAFE;">开启诊断服务，并在诊断过程中暂时不要操作手机</span>
					</p>
					<p>
						3、诊断完成后，灵豹将自动测算客户潜力分数，并生成行动推荐卡片<span style="color: #47BAFE;">（预计等待5~10分钟）</span>
					</p>
				</div>
				<div class="point_box">
					<div style="display: flex;align-items: center;margin-top: 0.07rem;margin-bottom: 0.05rem;">
						<span style="color: #47BAFE;font-size: 0.16rem;"><span class="mui-icon mui-icon-help" style="font-size: 0.22rem;">&nbsp;</span>使用帮助</span>
					</div>
					<p>
						1、如果微信无法正常诊断，请先清理后台应用，再重启灵豹APP
					</p>
					<p style="width:100%;word-break:break-all;word-wrap:break-word">2、使用过程中如有任何问题，请<a href="tel:17521351775" style="color: #47BAFE;">联系客服</a></p>
				</div>
			</div>

		</div>

		<div class="mui-content" id="pullrefresh" style="display: none;">
			<div id="batch_handle_box">
				<div class="tipXZ"><span>选中</span>
					<span id="XZ_COUNT">1人</span>
				</div>
				<div id="SYLBJ_BTN">
					<p class="iconfont iconyongjuanzhongxin"></p>
					<p>使用灵豹劵</p>
				</div>
				<div id="PLREMOVE_BTN">
					<p class="mui-icon mui-icon-trash"></p>
					<p>删除</p>
				</div>
				<div id="NOHANDLE_BTN">
					<p class="mui-icon mui-icon-undo"></p>
					<p>取消</p>
				</div>
			</div>
			<div class="searchinfo" style="top:43px;z-index: 100;;">
				<header class="mui-bar mui-bar-nav">
					<h1 class="mui-title" id="mui-title">客户列表</h1>
					<!-- <button type="button" class="head-button" id="batch" style="background: #0075bb;">客户诊断</button> -->
					<a class="mui-icon mui-icon-right-nav mui-pull-right iconfont" style="font-size: 22px;height: 50px;line-height: 50px;margin: 0px;padding: 0rem;font-weight: bold;padding-right: 0.05rem;"
					 id="batch">&#xe65f;</a>
				</header>
				<div class="mui-indexed-list-search mui-input-row mui-search">
					<input id="inpt" type="search" class=" mui-indexed-list-search-input  mui-input-clear" placeholder="搜索客户">
				</div>
				<div class="iconfont sorticon " pxtext="排序" id="paixuspan">&#xe6c6;</div>
			</div>


			<div class="linkman">
				<div class="gehe"></div>
				<div style="position: relative;">
					<div class="paixubox " id="paixubox">
						<p id="lingbao" style="color: #47BAFE;">灵豹分</p>
						<p id="name">姓名</p>
						<p id="time">最近互动</p>
						<p id="guanzhu">关注</p>
					</div>
					<ul class="ulList" id="users"></ul>
					<p id="noList_data" style="display: none;text-align: center;background: #f8f8f8;height: 0.4rem;line-height: 0.4rem;">没有更多客户信息了</p>
					<ul class="ulList" id="searchList" style="display: none;padding: 0rem;"></ul>
					<div class="mask" id="mask2"></div>

				</div>
				<div id="loading" class="load-wrapp">
					<div class="load-1">
						<p>Loading...</p>
						<div class="line"></div>
						<div class="line"></div>
						<div class="line"></div>
					</div>
				</div>
			</div>
		</div>

		<!-- 	<div id="topPopover">
			<div class="mui-popover-arrow"></div>
			<ul class="mui-table-view more_ul">
				<li class="mui-table-view-cell" style="color: #c5c5c5;">
					<span class="mui-icon-extra mui-icon-extra-addpeople"></span>
					<span>新增客户</span>
				</li>
				<li class="mui-table-view-cell" id="batch">
					<span class="mui-icon-extra mui-icon-extra-topic"></span>
					<span>批量诊断</span>
				</li>
				<li class="mui-table-view-cell" style="color: #c5c5c5;">
					<span class="mui-icon-extra mui-icon-extra-sweep"></span>
					<span>扫描名片</span>
				</li>
			</ul>

		</div>
 -->

		<!-- 	<script type="text/javascript">
			script(["../../js/mui.indexedlist2.js"]);
		</script> -->
		<!-- <script type="text/javascript">
			script();
		</script> -->
		<script type="text/javascript" src="../../js/app/smart-scroll.js"></script>
		<script type="text/javascript">
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					down: { //下拉刷新
						callback: pulldownRefresh,
						style: mui.os.android ? "circle" : "default"
					}
				},
				beforeback: function() {
					appPage.closeLogin();
				},
				gestureConfig: {
					longtap: true
				}
			});
			// mui.ready(function() {
			var ws = null,
				wc = null;
			let isLoading_in = false;
			mui.plusReady(function() {
				getData(parseInt(1));
				ws = plus.webview.currentWebview();
				ws.setStyle({
					scrollIndicator: "none"
				})
				// 用户点击后
				ws.addEventListener('maskClick', function() {
					wc.close('auto');
				}, false);
				var telImpBotton = document.getElementById("telImp");
				var wxImpButton = document.getElementById("wxImp");

				storage.init();
				storageUser = kidstorageuser.getInstance();
				//绑定[诊断手机联系人潜力]事件
				telImpBotton.addEventListener("tap", function() {
					localStorage.removeItem('customerData');
					pulldownRefresh();
					//openNew("addressbook.html");

					var REQUESTCODE = 1000;
					main = plus.android.runtimeMainActivity();
					var Intent = plus.android.importClass('android.content.Intent');
					var target = plus.android.importClass('com.linkpower.wechathelper.WechatRdActivity');
					var intent = new Intent(main, target.class);
					intent.putExtra("salesId", storageUser.UId);

					main.startActivityForResult(intent, REQUESTCODE);
				});

				//绑定[诊断微信好友潜力]事件
				//wxImpButton.addEventListener("tap", function() {
				//	localStorage.removeItem('customerData');
				//		localStorage.removeItem('customerData1');
				//	localStorage.removeItem('customerData2');
				//	localStorage.removeItem('customerData3');
				//	//openNew("addwei.html");
				//	var REQUESTCODE = 1000;
				//	main = plus.android.runtimeMainActivity();
				//	var Intent = plus.android.importClass('android.content.Intent');
				//	var target = plus.android.importClass('com.linkpower.wechathelper.WechatRdActivity');
				//	var intent = new Intent(main,target.class);
				//   intent.putExtra("salesId", storageUser.UId);

				//	main.startActivityForResult(intent, REQUESTCODE);
				//})

				//固定当前页面高度,防止软键盘弹出页面变形
				plus.webview.currentWebview().setStyle({
					height: document.documentElement.clientHeight || document.body.clientHeight
				});
				localStorage.setItem("isLoadCustomer", "yes");
			})


			function button_nav(index) {
				let val = parseInt(index);
				let m1 = document.getElementById("mask_nav1");
				let m2 = document.getElementById("mask_nav2");
				let m3 = document.getElementById("mask_nav3");
				let m4 = document.getElementById("mask_nav4");
				let m5 = document.getElementById("mask_nav5");
				switch (val) {
					case 1:
						m1.style.display = "none";
						m2.style.display = "block";
						break;
					case 2:
						m2.style.display = "none";
						m3.style.display = "block";
						break;
					case 3:
						m3.style.display = "none";
						m4.style.display = "block";
						break;
					case 4:
						m4.style.display = "none";
						m5.style.display = "block";
						break;
					case 5:
						m5.style.display = "none";
						document.getElementById("mask_navBox").style.display = "none";
						break;
					case 6:
						document.getElementById("kehu_yes").style.display = "none";
						document.getElementById("kehu_yes2").style.display = "block";
						// document.getElementById("kehu_yes").style.display = "block";
						break;
					case 7:
						document.getElementById("kehu_yes2").style.display = "none";
						document.getElementById("mask_navBox").style.display = "none";
						break;
					default:
						break;
				}
			}

			function showSide() {
				// 防止快速点击可能导致多次创建
				if (wc) {
					return;
				}
				// 开启遮罩
				ws.setStyle({
					mask: 'rgba(0,0,0,0.5)'
				});
				// 创建侧滑页面
				wc = createWithoutTitle('import_mask_side.html', {
					top: '0%',
					width: '100%',
					height: '68%',
					popGesture: 'none',
					titleNView: false
				});
				// 侧滑页面关闭后关闭遮罩
				wc.addEventListener('close', function() {
					ws.setStyle({
						mask: 'none'
					});
					wc = null;
				}, false);
				// 侧滑页面加载后显示（避免白屏）
				wc.addEventListener('loaded', function() {
					wc.show('slide-in-top');
				}, false);
			}

			function pulldownRefresh() {
				if (isLoading_in == true) {
					setTimeout(function() {
						mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
						document.getElementById("batch_handle_box").style.display = "none";
						ul.removeEventListener("tap", removetap, false);
						ul.addEventListener("tap", tapclick, false);
					}, 1000);
					return;
				}
				//初始化当前页
				// initPage();
				let pxtext = document.getElementById("paixuspan").getAttribute("pxtext");
				if (pxtext == "排序") {
					getData(parseInt(1));
				} else if (pxtext == "姓名") {
					localStorage.removeItem("customerData");
					namepx();
				} else if (pxtext == "灵豹分") {
					getData(parseInt(1));
				} else if (pxtext == "最近互动") {
					getData(parseInt(0));
				} else if (pxtext == "关注") {
					getData(parseInt(3));
				}
				// document.getElementById("batch_handle_box").style.display="none";


			}
			window.addEventListener("refreshPage", function() {
				pulldownRefresh();
			});
			document.addEventListener("refreshDOM", function(e) {
				// document.getElementById(e.detail.custId).style.backgroundColor="red";
				document.getElementById(e.detail.custId).querySelector("#customername").innerHTML = e.detail.custName;
			})

			function getData(sort) {

				storage.init();
				storageUser = kidstorageuser.getInstance();
				if (sort == 0) {
					sort_name = "last_touch_date"
				} else if (sort == 1) {
					sort_name = "score"
				} else if (sort == 2) {
					sort_name = "ext_consumption"
				} else if (sort == 3) {
					sort_name = "star_flg"
				}
				console.log("发起请求时间" + new Date());
				request("/cmdb/queryByCustomerID/", {
					sales_id: storageUser.UId,
					cust_id: " ",
					sort_name: sort_name,
					is_reverse: "-1"
				}, function(data) {
					// alert(data.DATASET.length);
					console.log("获取到数据时间" + new Date());
					if (data.DATASET.length == 0) {
						document.getElementById("pullrefresh").style.display = "none";
						document.getElementById("zanwushuju").style.display = "block";
						let isLoadCustomer = localStorage.getItem("isLoadCustomer");
						if (isLoadCustomer != "yes") {
							document.getElementById("mask_nav1").style.display = "block";
							document.getElementById("mask_navBox").style.display = "block";
						}
					} else {
						let isLoadCustomer = localStorage.getItem("isLoadCustomer_Ok");
						if (isLoadCustomer != "yes") {
							document.getElementById("mask_navBox").style.display = "block";
							document.getElementById("kehu_yes").style.display = "block";
							localStorage.setItem("isLoadCustomer_Ok", "yes");
						}

						localStorage.setItem("customerData", JSON.stringify(data));
						let keySearchData = localStorage.getItem("keySearchData");
						document.getElementById("zanwushuju").style.display = "none";
						document.getElementById("pullrefresh").style.display = "block";

						var inpt2 = document.getElementById('inpt');
						if (keySearchData != null && inpt2.value != "") { //如果搜索框和搜索的本地数据不为空,则再次调用keySearch方法使用ajax获取的数据进行搜索框筛选渲染
							// data = JSON.parse(keySearchData).DATASET;
							keySearch(data.DATASET);
						} else {
							setData(data, "getData");
						}
						console.log("渲染结束时间" + new Date());
					}
					// requestJsonFile("../../data/userlist.json", {}, function(request) {
				})

			}
			document.addEventListener("deleteDom", function(e) {
				let li = document.getElementById(e.detail.cust_id);
				li.remove();
				let count = document.getElementById("mui-title").innerHTML.split('(')[1].split(')')[0];
				let count2 = parseInt(count) - 1;
				document.getElementById("mui-title").innerHTML = "客户列表(" + count2 + ")";
			})

			function setData(request, type) { //防止数据过多渲染卡顿,分批渲染,0.16ms渲染一次
				isLoading_in = true;
				document.getElementById("batch_handle_box").style.display = "none";
				ul.removeEventListener("tap", removetap, false);
				ul.addEventListener("tap", tapclick, false);
				console.log("开始渲染");
				let data = request.DATASET;
				// alert(data.length);

				setTimeout(() => {
					// 插入数据
					const total = data.length
					// 一次插入 20 条，如果觉得性能不好就减少
					let once = 20
					// 渲染数据总共需要几次
					const loopCount = total / once
					let countOfRender = 0

					if (type == "search") {
						let ul = document.querySelector("#searchList");
					} else {
						let ul = document.querySelector("#users");
					}

					ul.innerHTML = "";

					function add() {
						// 优化性能，插入不会造成回流
						const fragment = document.createDocumentFragment();
						if (loopCount <= 1) {
							once = data.length;
						} else if (isXy1 != 0) {
							once = isXy1 * 20;
						} else {
							once = 20;
						}
						for (let j = 0; j < parseInt(once); j++) {
							let i = j + 20 * countOfRender;
							if (data[i].src == "0") {
								name = data[i].phone_nm;
							} else if (data[i].wechat_memo == "" || data[i].wechat_memo == null) {
								name = data[i].wechat_nm;
							} else {
								name = data[i].wechat_memo;
							}
							let img = "../../images/mrtxM.jpg";
							if (data[i].sex == "F") {
								img = "../../images/mrtxF.jpg";
							}

							let lastData;
							if (data[i].last_touch_date == null || data[i].last_touch_date == "" || data[i].last_touch_date == undefined) {
								lastData = "还没有互动";
							} else {
								let todaytime = getNowFormatDate(new Date());
								let today = new Date(todaytime);
								let lastTime = new Date(data[i].last_touch_date);
								let year = parseInt(today.getFullYear() - lastTime.getFullYear());
								let month = parseInt((today.getMonth() + 1) - (lastTime.getMonth() + 1));
								let day = parseInt(today.getDate() - lastTime.getDate());
								if (year == 0 && month == 0 && day >= 7) {
									lastData = parseInt(day / 7) + "星期前互动过";
								} else if (year == 0 && month != 0) {
									lastData = parseInt(month) + "个月前互动过"
								} else if (year != 0) {
									lastData = parseInt(year) + "年前互动过"
								} else if (year == 0 && month == 0 && day > 1 && day < 7) {
									lastData = parseInt(day) + "天前互动过"
								} else if (year == 0 && month == 0 && day == 1) {
									lastData = "昨天互动过"
								} else if (day == 0) {
									lastData = "今天互动过"
								}
							}
							let linbaoFen;
							if (data[i].score == undefined) {
								linbaoFen = 0;
							} else {
								// linbaoFen = getNowFormatDate(new Date());
								linbaoFen = data[i].score;
							}
							let guanzhuicon = '<img src="../../fonts/iconfont/kx.png" alt="" setstar="1" class="star" >';
							if (data[i].star_flg == "0") {
								guanzhuicon =
									'<img src="../../fonts/iconfont/kx.png"" alt="" setstar="1" class="star" >';
							} else {
								guanzhuicon =
									'<img src="../../fonts/iconfont/sx.png"" alt="" setstar="0" class="star" >';
							}
							let li_html = '<div  class="col-top"><p class="customername" id="customername" >' + name +
								'</p><p class="insertStar" custID="' + data[i].cust_id + '">' + guanzhuicon + '</p></div>' +
								'<div  class="col-center"><img src="' + img + '"/></div>' +
								'<div class="col-bottom"><p class="last_touch_date">' + lastData + '</p><span>' + linbaoFen + '</span></div>';
							const li = document.createElement("li");
							li.setAttribute("id", data[i].cust_id);
							li.setAttribute("custID", data[i].cust_id);
							li.setAttribute("customername", name);
							li.innerHTML = li_html;
							fragment.appendChild(li)
						}
						document.getElementById("mui-title").innerHTML = "客户列表(" + data.length + ")";
						ul.appendChild(fragment);
						// console.log(ul.getElementsByTagName("li").length);

						document.getElementById("loading").style.display = "none";
						document.getElementById("users").style.display = "flex";
						document.getElementById("noList_data").style.display = "block";
						// ul.innerHTML=fragment;

						if (loopCount - countOfRender <= 1) {
							isLoading_in = false;
						}
						if (loopCount - countOfRender <= 10) {
							mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
						}
						if (countOfRender < loopCount && loopCount - countOfRender >= 1) {
							countOfRender += 1;
							loop();
						}
					}
					let isXy1 = 0;

					function loop() {
						if (loopCount - countOfRender < 1) {
							isXy1 = Subtr(loopCount, countOfRender);

							// console.log(isXy1);
						} else {
							isXy1 = 0;
						}
						window.requestAnimationFrame(add);
					}
					add();
				}, 0);
			}

			let ul = document.getElementById("users");
			ul.addEventListener("touchstart", function(e) {
				let removeCount = document.getElementsByClassName("removeDiv2").length;
				if (e.target.nodeName == "UL" || removeCount > 0) {
					return;
				}
				var result = [];
				let dom = e.target;
				while (dom.nodeName != "LI") { //获取到指定的祖先li元素
					result.push(dom);
					dom = dom.parentNode;
				}
				const divObj = document.createElement("div");
				divObj.className = "removeDiv";
				dom.appendChild(divObj);
				// dom.style.backgroundColor="rgba(152, 211, 246, 0.87)";
				setTimeout(function() {
					divObj.style.transform = "translateX(0)";
				}, 0);
				setTimeout(function() {
					divObj.remove();
				}, 500)
			})

			ul.addEventListener("longtap", function(e) { //长按选中
				let removeCount = document.getElementsByClassName("removeDiv2").length;
				if (e.target.nodeName == "UL" || removeCount > 0) {
					return;
				}
				var result = [];
				let dom = e.target;
				while (dom.nodeName != "LI") { //获取到指定的li祖先元素
					result.push(dom);
					dom = dom.parentNode;
				}
				ul.removeEventListener("tap", tapclick, false);
				ul.addEventListener("tap", removetap, false);
				document.getElementById("batch_handle_box").style.display = "flex";
				let name = dom.getElementsByClassName("customername")[0].innerHTML;
				const divObj = document.createElement("div");
				divObj.innerHTML = '<p class="iconfont iconxuanzhong4"></p>';
				divObj.className = "removeDiv2";
				dom.appendChild(divObj);
				dom.style.animation = "removeliam 2s infinite linear";
				dom.querySelectorAll(".insertStar")[0].style.opacity = "0";
				setTimeout(function() {
					divObj.style.border = "1px solid #47BAEF";
				}, 0);
				dom.classList.add("removeli");
				document.getElementById("XZ_COUNT").innerText = document.getElementsByClassName("removeDiv2").length + "人";

			})

			function removetap(e) {
				if (e.target.nodeName == "UL") {
					return;
				}
				var result = [];
				let dom = e.target;
				while (dom.nodeName != "LI") { //获取到指定的li祖先元素
					result.push(dom);
					dom = dom.parentNode;
				}

				if (dom.className == "removeli") {
					dom.classList.remove("removeli");
					dom.style.animation = "none";
					dom.getElementsByClassName("removeDiv2")[0].style.border = "1px solid #f8f8f8";
					dom.getElementsByClassName("removeDiv2")[0].remove();
					dom.querySelectorAll(".insertStar")[0].style.opacity = "1";
					let removeCount = document.getElementsByClassName("removeDiv2").length;
					document.getElementById("XZ_COUNT").innerText = removeCount + "人";
					if (removeCount < 1) {
						ul.removeEventListener("tap", removetap, false);
						ul.addEventListener("tap", tapclick, false);
						document.getElementById("batch_handle_box").style.display = "none";

					}
				} else {
					let removeCount = document.getElementsByClassName("removeDiv2").length;
					if (removeCount >= 200) {
						mui.toast("每次最多选择200人");
						return;
					}
					let name = dom.getElementsByClassName("customername")[0].innerHTML;
					const divObj = document.createElement("div");
					divObj.innerHTML = '<p class="iconfont iconxuanzhong4"></p>';
					divObj.className = "removeDiv2";
					dom.appendChild(divObj);
					dom.querySelectorAll(".insertStar")[0].style.opacity = "0";
					divObj.style.border = "1px solid #47BAEF";
					dom.classList.add("removeli");
					dom.style.animation = "removeliam 2s infinite linear";
					document.getElementById("XZ_COUNT").innerText = document.getElementsByClassName("removeDiv2").length + "人";
				}
			}

			function tapclick(e) {
				var target = e.target || e.srcElement; //target获取触发事件的目标(li)
				// alert(e.target.getAttribute("class"));
				if (target.nodeName != 'UL' && target.nodeName.toLowerCase() != 'li' && target.getAttribute("class") !=
					'insertStar' && target.getAttribute("class") != 'star' && target.nodeName.toLowerCase() != 'li') {
					var result = [];
					let dom = target;
					while (dom.nodeName != "LI") { //获取到指定的祖先li元素
						result.push(dom);
						dom = dom.parentNode;
					}
					let name = dom.getAttribute("customername");
					mui.openWindow({
						url: '../customer/customerDetailInfo.html',
						id: 'customerDetail',
						extras: {
							custId: dom.getAttribute("custID")
						},
						styles: {
							titleNView: {
								autoBackButton: true,
								backgroundcolor: "#47BAFE",
								titleText: name,
								titlecolor: "white",
								buttons: [{
										fontSrc: 'fonts/mui.ttf',
										float: 'right',
										text: '\ue507',
										onclick: "javascript:plus.webview.getWebviewById('customerDetail').evalJS('showmore()');"
									},

								]
							},

						},
						waiting: {
							autoShow: false
						}
					})
					// setTimeout(function(){
					// 	plus.nativeUI.showWaiting();
					// },100);
				} else if (target.getAttribute("class") == 'insertStar' || target.getAttribute("class") == 'star') {
					var result = [];
					let dom = target;
					while (dom.getAttribute("class") != "insertStar") { //获取到指定的祖先li元素
						result.push(dom);
						dom = dom.parentNode;
					}
					insertStar(dom, dom.children[0], dom.getAttribute("custID"));
				}
			}
			ul.addEventListener("tap", tapclick, false);


			function removeCotomer(custID) { //删除客户
				mui.confirm('为保障您的信息安全，删除后无法恢复。您确定要删除选中客户吗？', function(e) {
					if (e.index == 0) {
						request('/cmdb/delByCustomerID/', {
							sales_id: storageUser.UId,
							cust_id: custID
						}, function(r) {
							let str = custID.split('#');
							if (str.length > 1) {
								for (let i = 0; i < str.length; i++) {
									document.getElementById(str[i]).remove();
								}
								let count = document.getElementById("mui-title").innerHTML.split('(')[1].split(')')[0];
								let count2 = parseInt(count) - parseInt(str.length);
								document.getElementById("mui-title").innerHTML = "客户列表(" + count2 + ")";
							} else {
								document.getElementById(custID).remove();
								let count = document.getElementById("mui-title").innerHTML.split('(')[1].split(')')[0];
								let count2 = parseInt(count) - 1;
								document.getElementById("mui-title").innerHTML = "客户列表(" + count2 + ")";

							}
							document.getElementById("batch_handle_box").style.display = "none";
							ul.removeEventListener("tap", removetap, false);
							ul.addEventListener("tap", tapclick, false);
							localStorage.removeItem("customerData");

						});
					}
				})
			}
			// id="SYLBJ_BTN"><p
			// id="PLREMOVE_BTN"
			// id="NOHANDLE_BTN"
			document.getElementById("SYLBJ_BTN").addEventListener("tap", function() { //使用灵豹劵
				request("/cmdb/getProfileBySalesId/", {
					sales_id: storageUser.UId
				}, function(data) {
					let arrCustID = "";
					let obj = document.getElementsByClassName("removeli");
					plus.nativeUI.showWaiting("请稍等...");
					let number = 0;
					for (let i = 0; i < obj.length; i++) {
						if (number == 0) {
							arrCustID = obj[i].getAttribute("custID");
						} else {
							arrCustID += "#" + obj[i].getAttribute("custID");
						}

						number++;
					}
					request("/cmdb/useLPTicketController/", {
						cust_id: arrCustID,
						sales_id: storageUser.UId
					}, function(r) {
						if (r.ERROR_CODE.trim() == "ERROR") {
							setTimeout(function() {
								plus.nativeUI.closeWaiting();
								mui.toast(r.ERROR_MESSAGE);
							}, 500);
						} else {
							let obj = document.getElementsByClassName("removeli");
							for (let i = 0; i < obj.length; i++) {
								obj[i].style.animation = "none";
								obj[i].getElementsByClassName("removeDiv2")[0].style.border = "1px solid #f8f8f8";
								obj[i].getElementsByClassName("removeDiv2")[0].remove();
								obj[i].querySelectorAll(".insertStar")[0].style.opacity = "1";
							}
							document.getElementById("batch_handle_box").style.display = "none";
							ul.removeEventListener("tap", removetap, false);
							ul.addEventListener("tap", tapclick, false);
							let liall = document.getElementById("users").querySelectorAll("li");
							for (let i = 0; i < liall.length; i++) {
								liall[i].classList.remove("removeli");
							}
							setTimeout(function() {
								mui.toast(r.ERROR_MESSAGE);
								plus.nativeUI.closeWaiting();
							}, 500);

						}
					})
				})
			})
			document.getElementById("PLREMOVE_BTN").addEventListener("tap", function() {
				let arrCustID = "";
				let obj = document.getElementsByClassName("removeli");
				let number = 0;
				for (let i = 0; i < obj.length; i++) {
					if (number == 0) {
						arrCustID = obj[i].getAttribute("custID");
					} else {
						arrCustID += "#" + obj[i].getAttribute("custID");
					}
					number++;
				}
				removeCotomer(arrCustID);
			})
			document.getElementById("NOHANDLE_BTN").addEventListener("tap", function() {
				let rli = document.getElementsByClassName("removeli");
				let liall = document.getElementById("users").querySelectorAll("li");
				for (let i = 0; i < rli.length; i++) {
					rli[i].getElementsByClassName("removeDiv2")[0].style.border = "1px solid #f8f8f8";
					rli[i].getElementsByClassName("removeDiv2")[0].remove();
					rli[i].querySelectorAll(".insertStar")[0].style.opacity = "1";
					rli[i].style.animation = "none";

				}
				for (let i = 0; i < liall.length; i++) {
					liall[i].classList.remove("removeli");
				}
				document.getElementById("batch_handle_box").style.display = "none";
				ul.removeEventListener("tap", removetap, false);
				ul.addEventListener("tap", tapclick, false);

			})
			document.getElementsByTagName("body")[0].addEventListener("touchstart", function() {

				// inpt.blur();

			})
			//搜索框功能

			var inpt = document.getElementById('inpt');

			inpt.addEventListener("keypress", function(e) {
				if (e.keyCode == 13) {
					inpt.blur();
				}
			})


			mui("body").on("tap", ".mui-icon-clear", function() {
				document.getElementById("noList_data").style.display = "block";
				let customerDatass = localStorage.getItem("customerData");
				let px_text = document.getElementById("paixuspan").getAttribute("pxtext");
				if (px_text == "姓名") {
					namepx();
				} else {
					document.getElementById("users").style.display = "block";
					document.getElementById("searchList").style.display = "none";
					setData(JSON.parse(customerDatass), "getData");
				}
				// localStorage.removeItem("keySearchData");
			});
			let nullCount = 0;
			inpt.addEventListener('keyup', function() {
				keySearch(0);
				document.getElementById("noList_data").style.display = "none";
				// render("#users", "userlist", dataarr_parse);
			})

			function keySearch(request) {
				let customerData = localStorage.getItem("customerData");
				let data;
				if (request == 0) {
					data = JSON.parse(customerData).DATASET;
				} else {
					data = request;
				}
				var inval = inpt.value;
				if (inval == "") {
					document.getElementById("noList_data").style.display = "block";
					nullCount += 1;
					if (nullCount >= 2) {
						localStorage.removeItem("keySearchData");
						return;
					} else {
						document.getElementById("users").style.display = "block";
						document.getElementById("searchList").style.display = "none";
					}
				} else {
					nullCount = 0;
				}
				var DATASET = [];
				for (let i = 0; i < data.length; i++) {
					var paraStr = data[i].src == "0" ? data[i].phone_nm : (data[i].wechat_memo == "" || data[i].wechat_memo == null ?
						data[i].wechat_nm : data[i].wechat_memo);
					if (paraStr.toLowerCase().indexOf(inval.toLocaleLowerCase()) >= 0) {
						DATASET.push(data[i]);
					}
				}

				var dataarr_parse = {
					DATASET
				};
				localStorage.setItem("keySearchData", JSON.stringify(dataarr_parse));
				if (document.getElementById("searchList").style.display == "none") {
					document.getElementById("users").style.display = "none";
					document.getElementById("searchList").style.display = "block";
				}

				setData(dataarr_parse, "search");
			}
			var isdj = 0;
			document.getElementById("paixuspan").addEventListener("tap", function() {
				// alert(isLoading_in);
				if (isLoading_in == true) {
					return;
				}
				if (isdj == 0) {
					document.getElementById("paixubox").style.transform = "translateY(0px)";
					document.getElementById("mask2").style.display = "block";
					isdj = 1;
				} else {
					document.getElementById("paixubox").style.transform = "translateY(-200px)";
					setTimeout(function() {
						document.getElementById("mask2").style.display = "none";
					}, 200);

					isdj = 0;
				}

			})
			let pbq = document.getElementById("paixubox").querySelectorAll("p");
			for (let i = 0; i < pbq.length; i++) {
				pbq[i].addEventListener("tap", function() {
					document.getElementById("batch_handle_box").style.display = "none";
					document.getElementById("noList_data").style.display = "none";
					isLoading_in = true;
					document.getElementById("paixubox").style.transform = "translateY(-200px)";
					isdj = 0;
					document.getElementById("users").style.display = "none";
					document.getElementById("loading").style.display = "block";
					document.getElementById("name").style.color = "black";
					document.getElementById("lingbao").style.color = "black";
					document.getElementById("time").style.color = "black";
					document.getElementById("guanzhu").style.color = "black";
					document.getElementById("mask2").style.display = "none";
					if (pbq[i].innerText == "灵豹分") {
						document.getElementById("lingbao").style.color = "#47BAFE";
						setTimeout(function() {
							getData(parseInt(1));
						}, 200);
					} else if (pbq[i].innerText == "最近互动") {
						document.getElementById("time").style.color = "#47BAFE";
						setTimeout(function() {
							getData(parseInt(0));
						}, 200);
					} else if (pbq[i].innerText == "关注") {
						document.getElementById("guanzhu").style.color = "#47BAFE";
						setTimeout(function() {
							getData(parseInt(3));
						}, 200);
					} else if (pbq[i].innerText == "姓名") {
						document.getElementById("name").style.color = "#47BAFE";
						setTimeout(function() {
							namepx();
						}, 200);
					}
					document.getElementById("paixuspan").setAttribute("pxtext", pbq[i].innerText)

				});
			}
			//名字排序
			function namepx() {
				let customerData = localStorage.getItem("customerData");
				if (customerData != "" && customerData != undefined && customerData != null) {
					// DATASET= JSON.parse(customerData).DATASET;
					sortName(JSON.parse(customerData).DATASET);
				} else {
					storage.init();
					storageUser = kidstorageuser.getInstance();
					request("/cmdb/queryByCustomerID/", {
						sales_id: storageUser.UId,
						cust_id: " ",
						sort_name: "score",
						is_reverse: "1"
					}, function(request) {
						localStorage.setItem("customerData", JSON.stringify(request));
						sortName(request.DATASET)
					})
				}


			}

			function sortName(DATASET) {
				DATASET.sort(function(a, b) {
					let name1;
					if (a.src == "0") {
						name1 = a.phone_nm
					} else if (a.wechat_memo == "" || a.wechat_memo == null) {
						name1 = a.wechat_nm
					} else {
						name1 = a.wechat_memo
					}
					let name2;
					if (b.src == "0") {
						name2 = b.phone_nm
					} else if (b.wechat_memo == "" || b.wechat_memo == null) {
						name2 = b.wechat_nm
					} else {
						name2 = b.wechat_memo
					}
					if (!isNaN(Number(name1.substring(0, 1)))) {
						name1 = "Z";
					}
					if (!isNaN(Number(name2.substring(0, 1)))) {
						name2 = "Z";
					}
					let PinYin1 = ConvertPinyin(name1).substring(0, 1);
					let PinYin2 = ConvertPinyin(name2).substring(0, 1);
					if (/^[a-z]+$/.test(PinYin1)) {
						PinYin1 = PinYin1.toUpperCase();
					}
					if (/^[a-z]+$/.test(PinYin2)) {
						PinYin2 = PinYin2.toUpperCase();
					}
					return PinYin1 > PinYin2 ? 1 : -1;

				});
				var dataarr_parse2 = {
					DATASET
				};
				let keySearchData = localStorage.getItem("keySearchData");
				var inpt2 = document.getElementById('inpt');
				if (keySearchData != null && inpt2.value != "") { //如果搜索框和搜索的本地数据不为空,则再次调用keySearch方法使用ajax获取的数据进行搜索框筛选渲染
					// data = JSON.parse(keySearchData).DATASET;
					keySearch(dataarr_parse2.DATASET);
				} else {
					setData(dataarr_parse2, "getData");
				}
			}
			//菜单批量导入
			var batch = document.getElementById('batch');
			batch.addEventListener('tap', function() {
					setTimeout(function() {
						mui.openWindow({
							url: 'customerDiagnosis.html',
							id: 'customerDiagnosis.html',
							styles: {
								titleNView: {
									autoBackButton: true,
									backgroundcolor: "#47BAFE",
									titleText: "批量诊断",
									titlecolor: "white",
									buttons: [{
											fontSrc: 'fonts/mui.ttf',
											float: 'right',
											text: '\ue505',
											onclick: "javascript:plus.webview.getWebviewById('customerDiagnosis.html').evalJS('showSide()');"
										},

									]
								},

							},
							waiting: {
								autoShow: false
							}
						})
					}, 50);

				}

			)
			// openNew("customerDiagnosis.html");
			// closeMask();




			function insertStar(event, elm, cid) { //星标标记
				storage.init();
				storageUser = kidstorageuser.getInstance();
				let star = elm.getAttribute("setstar");
				request("/cmdb/updateCustomerStarFlg/", {
					cust_id: cid,
					sales_id: storageUser.UId,
					star_flg: star
				}, function(r) {
					if (r.ERROR_CODE == "SUCCESS") {
						if (star == 0) {
							elm.src = "../../fonts/iconfont/kx.png";
							elm.setAttribute("setstar", "1");
							// elm.onclick="insertStar(this,1,'{{value.id}}')";
						} else if (star == 1) {
							elm.src = "../../fonts/iconfont/sx.png";
							elm.setAttribute("setstar", "0");
							// elm.onclick="insertStar(this,0,'{{value.id}}')";
						}
						// mui.toast("操作成功");
					}
				})

			}
			let obj = document.getElementById("mask");
			// obj.addEventListener("click", showmore);
			let yn = 0;
			// document.getElementById("openMask").addEventListener("tap", function() {
			// 	showmore();
			// })
			document.getElementById("mask").addEventListener("touchstart", function() {
				closeMask();
			})

			// 
			// 			function showmore() {
			// 				document.getElementById("paixubox").style.transform = "translateY(-2rem)";
			// 				isdj = 0;
			// 				if (yn == 0) {
			// 					document.getElementById("topPopover").style.display = "block",
			// 						obj.style.display = "block";
			// 					yn = 1;
			// 				} else {
			// 					closeMask();
			// 					document.getElementById("paixubox").style.transform = "translateY(-2rem)";
			// 					isdj = 0;
			// 					yn = 0;
			// 				}
			// 
			// 			}

			// function closeMask() {
			// 	document.getElementById("topPopover").style.display = "none",
			// 		obj.style.display = "none";
			// 	yn = 0;
			// }
			document.getElementById("mask2").addEventListener("touchstart", function() {
				event.preventDefault();
				document.getElementById("paixubox").style.transform = "translateY(-200px)";
				setTimeout(function() {
					document.getElementById("mask2").style.display = "none";
				}, 200);
				isdj = 0;
			});
			document.getElementById("mask2").addEventListener("click", function() {
				document.getElementById("paixubox").style.transform = "translateY(-200px)";
				document.getElementById("mask2").style.display = "none";
			})
		</script>
	</body>

</html>
